﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataChangeTools.Utils
{
    public class ProcessHelper
    {

        public static void KillProcess(string processName)
        {
            foreach (var process in Process.GetProcesses())
            {
                if (!process.ProcessName.ToUpper().Contains(processName.ToUpper())) continue;

                try
                {
                    process.Kill();
                    process.WaitForExit();
                }
                catch (Win32Exception)
                {
                }
            }
        }
    }
}
